package com.djhu.es.core.annotation;

/**
 * Created by zw on 2017/12/28.
 */
public enum QueryType {
    TERMQUERY(1),
    MATCHQUERY(2),
    FUZZYQUERY(3),
    RANGEQUERY(4),
    PRIFIXQUERY(5),
    WILDQUERY(6);


    public final int code;

    QueryType(int code){
        this.code =code;
    }

    public static QueryType valueOf(int code){
        QueryType queryType = TERMQUERY;
        switch (code) {
            case 1:
                queryType = TERMQUERY;
                break;
            case 2:
                queryType = MATCHQUERY;
                break;
            case 3:
                queryType = FUZZYQUERY;
                break;
            case 4:
                queryType = RANGEQUERY;
                break;
            case 5:
                queryType = PRIFIXQUERY;
                break;
            case 6:
                queryType = WILDQUERY;
                break;
            default:
                break;
        }
        return queryType;
    }

}
